<template>
  <div class="wrapper">
    <div class="btn-login" @click="login">登陆</div>
  </div>
</template>
<script>
export default {
  created () {
    this.getUrlParams()
  },
  data () {
    return {
      fromPath: null
    }
  },
  watch: {
    '$route': 'getUrlParams'
  },
  methods: {
    getUrlParams () {
      this.fromPath = this.$route.query.redirect
    },
    login () {
      window.localStorage.setItem('KEBAN-SESSION', '1234567')
      this.$router.replace({path: this.fromPath})
    }
  }
}
</script>
